const path = require('path');

module.exports = {
    mode: 'production',
    entry: './src/app.ts',
    output: {
        path: path.resolve(__dirname, 'dist/bundle'),
        filename: 'ssloader.min.js'
    },
    resolve: {
        // 执行import { showHelloWorld } from './common'; 
        // 先尝试 ts 后缀的 TypeScript 源码文件，在尝试 js 后缀 JavaScript 源码文件
        extensions: ['.ts', '.js']
    },
    module: {
        rules: [{
            test: /\.tsx?$/,
            exclude: /node_modules/,            
            use: {
                loader: 'babel-loader',
                options: {
                    presets: [
                        '@babel/preset-env',
                        '@babel/preset-typescript'
                    ],
                    //   plugins: [
                    //     ['import', { libraryName: 'antd', style: 'css' }], // `style: true` 会加载 less 文件
                    //   ],
                }
            }
        }]
    },
    plugins: [

    ]
};